var routes = [{
		path: "/account/login",
		name: "登录",
		meta : {
			hasToken : false
		}, 
		component: resolve => require(["@/components/account/login"], resolve)
	},{
		path: "/account/register",
		name: "注册",
		meta : {
			hasToken : false
		},
		component: resolve => require(["@/components/account/register"], resolve)
	},{
		path: "/account/forget_password",
		name: "忘记密码",
		meta : {
			hasToken : false
		},
		component: resolve => require(["@/components/account/reset_password"], resolve)
	},{
		path: "/account/update_password",
		name: "修改密码",
		meta : {
			hasToken : true
		},
		component: resolve => require(["@/components/account/reset_password"], resolve)
	},
//	{
//		path: "/privacy_policy",
//		name: "隐私条款",
//		component: resolve => require(["@/components/common/privacy_policy"], resolve)
//	},
	{
		path: "/",
		redirect: {
			name: '首页'
		}
	},
	{
		path: "",
		name: "布局页",
		component: resolve => require(["@/components/common/home"], resolve),
		children: [
//			{
//				path: "/home_page/home_page",
//				name: "旧首页",
//				component: () => import("@/components/home_page/home_page")
//			},
			{
				path: "/home_page/index",
				name: "首页",
				component: resolve => require(["@/components/home_page/index"], resolve)
			},
//			{
//				path: "/course_detail/course_detail",
//				name: "课程详情",
//				component: () => import("@/components/course_detail/course_detail")
//			},{
//				path: "/thinking_course/thinking_course",
//				name: "思维课程",
//				component: () => import("@/components/thinking_course/thinking_course")
//			},
			{
				path: "/download_center/download_center",
				name: "下载中心",
				component: resolve => require(["@/components/download_center/download_center"], resolve)
			},
			{
				path: "/about/about",
				name: "关于我们",
				component: resolve => require(["@/components/about/about"], resolve)
			},
			{
				path: "",
				name: "个人中心",
				component: resolve => require(["@/components/personal_center/personal_center"], resolve),
				children: [{
						path: "/personal_center/person_info",
						name: "个人信息",
						meta : {
							hasToken : true
						},
						component: resolve => require(["@/components/personal_center/person_info"], resolve)
					},{
						path: "/personal_center/person_curriculum",
						name: "我的课程",
						meta : {
							hasToken : true
						},
						component: resolve => require(["@/components/personal_center/person_curriculum"], resolve)
					},{
						path: "/personal_center/person_order",
						name: "我的订单",
						meta : {
							hasToken : true
						},
						component: resolve => require(["@/components/personal_center/person_order"], resolve)
					},{
						path: "/personal_center/person_timetable",
						name: "我的课表",
						meta : {
							hasToken : true
						},
						component: resolve => require(["@/components/personal_center/person_timetable"], resolve)
					},,{
						path: "/personal_center/help_center",
						name: "帮助中心",
						component: resolve => require(["@/components/personal_center/help_center"], resolve)
					},{
						path: "/personal_center/curriculum_details",
						name: "curriculum_details",
						meta : {
							hasToken : true
						},
						component: resolve => require(["@/components/personal_center/curriculum_details"], resolve)
					}
				]
			},{
				path: "/personal_center/class_room",
				name: "网络教室",
				meta : {
					hasToken : true
				},
				component: resolve => require(["@/components/personal_center/class_room"], resolve)
			},
		]
	},{
		path: "*",
		name: "不存在页",
		component: resolve => require(["@/components/common/none"], resolve)
	}

];

const pushFun = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  	return pushFun.call(this, location).catch(err => err)
}

export default new VueRouter({
	routes: routes
})